Skip to content

Add a clear search and filters action to the empty state#48

Open
HMAKT99 wants to merge 2 commits into
Forward-Future:mainfrom
HMAKT99:feat/clear-filters-empty-state
Open

Add a clear search and filters action to the empty state#48
HMAKT99 wants to merge 2 commits into
Forward-Future:mainfrom
HMAKT99:feat/clear-filters-empty-state

Conversation

@HMAKT99

@HMAKT99 HMAKT99 commented Jun 21, 2026

Copy link
Copy Markdown
Contributor

Summary

When a search query or category filter matches no loops, the empty state reads:

Try another category, broaden your search, or submit the workflow.

…but offers no direct way to actually do that. The only ways back to the full catalog are manually clearing the search box or hunting for the All category chip — extra friction at exactly the dead-end moment.

This adds a Clear search & filters button to the empty state that:

  • clears the search input,
  • resets the active category to All (updating the chip is-active / aria-pressed state),
  • resets pagination to page 1 and re-renders the full catalog, and
  • returns focus to the search box so keyboard users can immediately type a new query.

Changes

  • site/index.html — wrap the empty-state actions and add the reset button.
  • site/script.js — wire the button to reset query + category and refocus search.
  • site/styles.css — style the button to match the existing pagination/control buttons (including :focus-visible).

Verification

  • node scripts/check.mjsLoop Library checks passed.
  • node --check site/script.js
  • Builders (build-skill-catalog, build-loop-pages, build-social-images) → no artifact drift.

When a search or category filter returns no loops, the empty state asks
the visitor to broaden the search but offers no direct way to do it,
leaving the only reset paths as manually clearing the input or hunting
for the All category. Add a Clear search & filters button that resets the
query and category to the default view, then returns focus to the search
box so keyboard users can immediately type a new query.
@HMAKT99

HMAKT99 commented Jun 21, 2026

Copy link
Copy Markdown
Contributor Author

Small UX follow-on: when a search or filter returns nothing, the empty state asks people to "broaden your search" but doesn't give them a way to do it. This adds a Clear search & filters button that resets to the default view and returns focus to the search box.

I matched the existing pagination/control button styling (including :focus-visible) so it should feel native. Full check suite + builders pass with no artifact drift. No worries if you'd rather style it differently — easy to adjust.

@mberman84 mberman84 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The reset behavior is correct in browser verification: it clears the query/category/page, restores the All chip's ARIA state, hides the empty state, and returns focus to search.

One deployment blocker remains: this changes both site/script.js and site/styles.css while pages still request the existing ?v=20260620-newest-first URLs. Cached visitors can receive the new button markup with old JavaScript/CSS, leaving the action inert or unstyled. Please bump the shared asset version across the homepage, Learn/Agents pages, generated loop pages, the page generator, and scripts/check.mjs, then regenerate affected pages.

Per review: the empty-state reset changes both site/script.js and
site/styles.css, so cached visitors could load the new button markup with
stale JavaScript/CSS, leaving it inert or unstyled. Bump both shared asset
versions to 20260621-empty-state across the homepage, Learn/Agents pages,
the loop-page generator, and scripts/check.mjs, then regenerate the loop
pages.
@HMAKT99

HMAKT99 commented Jun 21, 2026

Copy link
Copy Markdown
Contributor Author

Bumped both shared asset versions (script.js and styles.css) to 20260621-empty-state across the homepage, Learn/Agents pages, the loop-page generator, and scripts/check.mjs, then regenerated the loop pages — so cached visitors can't get the new button markup with stale JS/CSS. Check suite + builders green.

@HMAKT99

HMAKT99 commented Jun 21, 2026

Copy link
Copy Markdown
Contributor Author

@mberman84 ready for re-review when convenient — both script.js and styles.css versions are bumped and pages regenerated. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants